import request from "@/utils/request";

export const reqSpuImageList=(spuId)=>{
    return request({url:`/admin/product/spuImageList/${spuId}`,method:'get'})
}

export const reqSpuSaleAttrList=(spuId)=>{
    return request({url:`/admin/product/spuSaleAttrList/${spuId}`,method:'get'})
}

export const reqAttrInfoList=(category1ID,category2ID,category3ID)=>{
return request({url:`/admin/product/attrInfoList/${category1ID}/${category2ID}/${category3ID}`,method:"get"})
}

// 添加sku
export const reqAddSku=(skuInfo)=>{
    return request({url:"/admin/product/saveSkuInfo",method:"post"})
}

// 获取sku列表数据的接口
export const reqSkuList=(spuId)=>{
    return request({url:`/admin/product/findBySpuId/${spuId}`,method:"get"})
}

export const reqGetSkuList=(page,limit)=>{
    return request ({url:`/admin/product/list/${page}/${limit}`,method:"get"})
}

// 上架
export const reqSale=(skuId)=>{
    return request({url:`/admin/product/onSale/${skuId}`,method:"get"})
}

// 下架
export const reqCancel=(skuId)=>{
    return request({url:`/admin/product/cancelSale/${skuId}`,method:"get"})
}

// 获取sku详情
export const reqSkuById=(skuId)=>{
    return request({url:`/admin/product/getSkuById/${skuId}`,method:"get"})
}